﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Management.Automation;

namespace Obra.PowerShell.SmugMug
{
    static class CmdletProviderHelper
    {
        public static void WriteInvalidArgumentErrorRecord(
            CmdletProvider provider, 
            string description, 
            string errorId, 
            object target)
        {
            provider.WriteError(new ErrorRecord(
                new ArgumentException(description),
                errorId,
                ErrorCategory.InvalidArgument,
                target));
        }


        public static void WriteInvalidPathErrorRecord(
            CmdletProvider provider, 
            string path)
        {
            provider.WriteError(new ErrorRecord(
                new ArgumentException("path"),
                "InvalidPath",
                ErrorCategory.InvalidArgument,
                path));
        }
    }
}
